home *** CD-ROM | disk | FTP | other *** search
/ Aminet 22 / Aminet 22 (1997)(GTI - Schatztruhe)[!][Dec 1997].iso / Aminet / dev / e / amigae33a.lha / E_v3.3a / Src.lha / Src / Tools / AmigaLib / io.e < prev    next >
Text File  |  1995-03-23  |  820b  |  43 lines

  1. OPT MODULE
  2.  
  3. MODULE 'exec/io',
  4.        'exec/memory',
  5.        'exec/nodes',
  6.        'exec/ports'
  7.  
  8. ENUM ERR_NONE, ERR_SIG
  9.  
  10. RAISE ERR_SIG IF AllocSignal()=-1
  11.  
  12. EXPORT PROC beginIO(ioreq:PTR TO io)
  13.   DEF base
  14.   base:=ioreq.device
  15.   MOVEA.L base, A6
  16.   MOVEA.L ioreq, A1
  17.   JSR -30(A6)
  18. ENDPROC
  19.  
  20. EXPORT PROC createStdIO(port) IS createExtIO(port, SIZEOF iostd)
  21.  
  22. EXPORT PROC deleteStdIO(ioReq) IS deleteExtIO(ioReq)
  23.  
  24. EXPORT PROC createExtIO(port, ioSize) HANDLE
  25.   DEF ioReq=NIL:PTR TO io
  26.   IF port
  27.     ioReq:=NewM(ioSize, MEMF_CLEAR OR MEMF_PUBLIC)
  28.     ioReq.mn.ln.type:=NT_REPLYMSG
  29.     ioReq.mn.length:=ioSize
  30.     ioReq.mn.replyport:=port
  31.   ENDIF
  32. EXCEPT DO
  33. ENDPROC ioReq
  34.  
  35. EXPORT PROC deleteExtIO(ioReq:PTR TO io)
  36.   IF ioReq
  37.     ioReq.mn.ln.succ:=-1
  38.     ioReq.mn.replyport:=-1
  39.     ioReq.device:=-1
  40.     Dispose(ioReq)
  41.   ENDIF
  42. ENDPROC
  43.